home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 September / CHIP Eylül 1998.iso / Slackwar / docs / Printing-HOWTO < prev    next >
Text File  |  1997-09-25  |  47KB  |  1,108 lines

  1.   The Linux Printing HOWTO
  2.   Grant Taylor <gtaylor+pht@picante.com>
  3.   v3.14, 23 September 1997
  4.  
  5.   This is the Linux Printing HOWTO, a collection of information on how
  6.   to generate, preview, print and fax anything under Linux (and other
  7.   Unices in general).
  8.  
  9.   1.  Introduction
  10.  
  11.   The Printing HOWTO should contain everything you need to know to help
  12.   you set up printing services on your Linux box(en).  As life would
  13.   have it, it's a bit more complicated that in the point-and-click world
  14.   of Microsoft and Apple, but it's also a bit more flexible and
  15.   certainly easier to administer for large LANs.
  16.  
  17.   This document is ordered such that most people will only need to read
  18.   the first half or so.  Much of the more obscure and situation-
  19.   dependant information in here is in the last half, and can be easily
  20.   located in the Table of Contents, whereas most of the information
  21.   through section 9 or 10 is probably needed by most people.
  22.  
  23.   Since version 3.x is a complete rewrite, much information from
  24.   previous editions has been lost.  This is by design, as the previous
  25.   HOWTOs were so large as to be 60 typeset pages, and had the narrative
  26.   flow of a dead turtle.  If you do not find the answer here, you are
  27.   encouraged to a) scan the previous version at The PHT Home Page
  28.   <http://www.picante.com/~gtaylor/pht/> and b) drop me a note saying
  29.   what ought to be here but isn't.
  30.  
  31.   The Printing HOWTO Home Page <http://www.picante.com/~gtaylor/pht/> is
  32.   a good place to find the latest version; it is also, of course,
  33.   distributed from SunSite (sunsite.unc.edu) and your friendly local LDP
  34.   mirror.
  35.  
  36.   1.1.  History
  37.  
  38.   This is the third generation, which is to say the third complete
  39.   rewrite, of the Printing HOWTO.  The history of the PHT may be
  40.   chronicled thusly:
  41.  
  42.   1. I wrote the printing-howto in 1992 in response to too many printing
  43.      questions in comp.os.linux, and posted it.  This predated the HOWTO
  44.      project by a few months and was thus the first FAQlet called a
  45.      `howto'.  This edition was in plain ascii.
  46.  
  47.   2. After joining the HOWTO project, the Printing-HOWTO was merged with
  48.      an Lpd FAQ by Brian McCauley <B.A.McCauley@bham.ac.uk>; we
  49.      continued to co-author the PHT for two years or so.  At some point
  50.      we incorporated the work of Karl Auer <Karl.Auer@anu.edu.au>.  This
  51.      generation of the PHT was in TeXinfo, and available in PS, HTML,
  52.      Ascii, and Info.
  53.  
  54.   3. After letting the PHT rot and decay for over a year, and an
  55.      unsuccessful attempt at getting someone else to maintain it, this
  56.      rewrite happened.  This generation of the PHT is in Linuxdoc-SGML.
  57.  
  58.   1.2.  Copyright
  59.  
  60.   This document is Copyright (c) 1997 by Grant Taylor.  Please copy and
  61.   distribute it widely, but do not modify the text or omit my name.
  62.  
  63.   2.  How to print
  64.  
  65.   If you've already got lpd setup to print to your printer, or your
  66.   system administrator already did so, or your vendor did so for you,
  67.   then all you need to do is learn how to use the lpr command.  The
  68.   Printing Usage HOWTO <http://sunsite.unc.edu/LDP/HOWTO/Printing-Usage-
  69.   HOWTO.html> covers this, and a few other queue manipulation commands
  70.   you should probably know.
  71.  
  72.   If, however, you have a new system or new printer, then you'll have to
  73.   set up printing services one way or another before you can print.
  74.   Read on!
  75.  
  76.   3.  Kernel printer devices
  77.  
  78.   3.1.  The lp device
  79.  
  80.   The Linux kernel (<=2.1.32), assuming you have compiled in or loaded
  81.   the lp device (the output of cat /proc/devices should include the
  82.   device lp), provides one or more of /dev/lp0, /dev/lp1, and /dev/lp2.
  83.   These are NOT assigned dynamically, rather, each corresponds to a
  84.   specific hardware I/O address.  This means that your first printer may
  85.   be lp0 or lp1 depending on your hardware.  Try both ;)
  86.  
  87.   A few users have reported that their bidirectional lp ports aren't
  88.   detected if they use an older unidirectional printer cable.  Check
  89.   that you've got a decent cable.
  90.  
  91.   One cannot run the plip and lp drivers at the same time on any given
  92.   port.  You can, however, have one or the other driver loaded at any
  93.   given time either manually, or by kerneld with version 2.x (and later
  94.   1.3.x) kernels.  By carefully setting the interrupts and such, you can
  95.   supposedly run plip on one port and lp on the other.  One person did
  96.   so by editing the drivers; I eagerly await a success report of someone
  97.   doing so with only a clever command line.
  98.  
  99.   There is a little utility called tunelp floating about with which you,
  100.   as root, can tune the Linux lp device's interrupt usage, polling rate,
  101.   and other options.
  102.  
  103.   When built in to some 1.3.x and later kernels, the kernel will accept
  104.   an lp= option to set interrupts and io addresses:
  105.  
  106.        When the lp driver is built in to the kernel, you may use the
  107.        LILO/LOADLIN command line to set the port addresses and interrupts
  108.        that the driver will use.
  109.  
  110.        Syntax:      lp=port0[,irq0[,port1[,irq1[,port2[,irq2]]]]]
  111.  
  112.        For example:   lp=0x378,0   or   lp=0x278,5,0x378,7 **
  113.  
  114.        Note that if this feature is used, you must specify *all* the ports
  115.        you want considered, there are no defaults.  You can disable a
  116.        built-in driver with lp=0.
  117.  
  118.   When loaded as a module in version 2 and late-model 1.3.x kernels, it
  119.   is possible to specify io addresses and interrupt lines on the insmod
  120.   command line (or in /etc/conf.modules so as to affect kerneld) using
  121.   the usual syntax.  The parameters are io=port0,port1,port2 and
  122.   irq=irq0,irq1,irq2.  Read ye the man page for insmod for more
  123.   information on this.
  124.   **For those of you who (like me) can never find the standard port
  125.   numbers when you need them, they are as in the second example above.
  126.   The other port (lp0) is at 0x3bc.  I've no idea what interrupt it
  127.   usually uses.
  128.  
  129.   The source code for the Linux parallel port driver is in
  130.   /usr/src/linux/drivers/char/lp.c.
  131.  
  132.   3.2.  The parport device (kernels >= 2.1.33)
  133.  
  134.   Beginning with kernel 2.1.33 (and available as a patch for kernel
  135.   2.0.30), the lp device is merely a client of the new parport device.
  136.   The addition of the parport device corrects a number of the problems
  137.   that plague the old lp device driver - it can share the port with
  138.   other drivers, it dynamically assigns available parallel ports to
  139.   device numbers rather than enforcing a fixed correspondence between
  140.   I/O addresses and port numbers, and so forth.
  141.  
  142.   I'll cover the parport driver more completely when I find myself using
  143.   one, but in the meantime you can read the file
  144.   Documentation/parport.txt in your kernel sources, or look at the
  145.   parport web site <http://www.cyberelk.demon.co.uk/parport.html>.
  146.  
  147.   3.3.  Serial devices
  148.  
  149.   Serial devices are usually called something like /dev/ttyS1 under
  150.   Linux.  The utility stty will allow you to interactively view or set
  151.   the settings for a serial port; setserial will allow you to control a
  152.   few extended attributes and configure IRQs and I/O addresses for non-
  153.   standard ports.  Further discussion of serial ports under Linux may be
  154.   found in the Serial-HOWTO <http://sunsite.unc.edu/mdw/HOWTO/Serial-
  155.   HOWTO.html>.
  156.  
  157.   When using a slow serial printer with flow control, you may find that
  158.   some of your print jobs get truncated.  This may be due to the serial
  159.   port, whose default behavior is to purge any untransmitted characters
  160.   from its buffer 30 seconds after the port device is closed.  The
  161.   buffer can hold up to 4096 characters, and if your printer uses flow
  162.   control and is slow enough that it can't accept all the data from the
  163.   buffer within 30 seconds after printing software has closed the serial
  164.   port, the tail end of the buffer's contents will be lost.  If the
  165.   command cat file > /dev/ttyS2 produces complete printouts for short
  166.   files but truncated ones for longer files, you may have this
  167.   condition.
  168.  
  169.   The 30 second interval can be adjusted through the "closing_wait"
  170.   commandline option of setserial (version 2.12 and later).  A machine's
  171.   serial ports are usually initialized by a call to setserial in the
  172.   rc.serial boot file.  The call for the printing serial port can be
  173.   modified to set the closing_wait at the same time as it sets that
  174.   port's other parameters.
  175.  
  176.   4.  Supported Printers
  177.  
  178.   The Linux kernel mostly supports any printer that you can plug into a
  179.   serial or parallel port, but there are things to look out for, and
  180.   printers that you won't be able to use, even though they can
  181.   (electrically speaking) communicate with Linux.  Primary among these
  182.   incompatible printers are those that rely on the "Windows Printing
  183.   System".  (They're often vaguely labelled "for Windows".)  These
  184.   printers do not work with Linux.  They haven't any "smarts" at all,
  185.   and rely on the computer CPU to do much of the tasks that have been
  186.   traditionally done by the printer's CPU.  Unfortunately, these tasks
  187.   can only be done by the vendor-supplied drivers, which only run under
  188.   Windows.  So don't buy one to use with Linux.
  189.  
  190.   As for what printers do work with Linux, the best choice is to buy a
  191.   printer with native PostScript support.  Nearly all Unix software that
  192.   produces printable output produces it in PostScript, so obviously it'd
  193.   be nice to get a printer that supports PostScript directly.
  194.   Unfortunately, PostScript support is scarce outside the laser printer
  195.   domain.
  196.  
  197.   Failing the (larger) budget necessary to buy a PostScript printer, you
  198.   can use any printer supported by Ghostscript, the free PostScript
  199.   interpreter used in lieu of actual printer PostScript support.  The
  200.   Ghostscript Home Page <http://www.cs.wisc.edu/~ghost/> has a list of
  201.   supported printers and information on the status of new and
  202.   experimental drivers.  Please help improve the Ghostscript printer
  203.   support page by reorting your successes and failures as it asks.
  204.  
  205.   5.  Which spooling software?
  206.  
  207.   Until recently, the choice for Linux users was simple - everyone ran
  208.   the same old lpd lifted mostly verbatim out of BSD's Net-2 code.  Even
  209.   today, most vendors ship this software.  But this is beginning to
  210.   change.  SVR4-like systems including Sun's Solaris come with a
  211.   completely different print spooling package, centered around lpsched.
  212.   And there are signs that some Linux vendors will shift to providing
  213.   LPRng, a far less ancient print spooling implementation that is freely
  214.   available.  LPRng is far easier to administer for large installations
  215.   and has a less frightfully haphazard codebase than does stock lpd.
  216.  
  217.   For the moment, even in light of the new options, lpd is probably fine
  218.   for most Linux users.  While it isn't the snazziest system, it works
  219.   fine once set up, and it is well understood and extensively documented
  220.   in third-party Unix books.
  221.  
  222.   If you'd like more information on LPRng, check out LPRng - An Enhanced
  223.   Printer Spooler
  224.   <http://ltpwww.gsfc.nasa.gov/ltpcf/about/unix/Depotdoc/LPRng/>.
  225.   Future versions of this HOWTO will include information on using both
  226.   LPRng and regular lpd.
  227.  
  228.   6.  How it works, basic
  229.  
  230.   In order to get printing working well, you need to understand how the
  231.   lpd system works.
  232.  
  233.   Lpd stands for Line Printer Daemon, and refers in different contexts
  234.   to both the daemon and the whole collection of programs which run
  235.   print spooling.  These are:
  236.  
  237.      lpd
  238.         The spooling daemon.  One of these runs to control everything on
  239.         a machine, AND one is run per printer while the printer is
  240.         printing.
  241.  
  242.      lpr
  243.         The user spooling command.  Lpr contacts lpd and injects a new
  244.         print job into the spool.
  245.  
  246.      lpq
  247.         Lists the jobs in a print queue.
  248.  
  249.      lpc
  250.         The Lpd system control command.  With lpc you can stop, start,
  251.         reorder, etc, the print queues.
  252.  
  253.      lprm
  254.         lprm will remove a job from the print spool.
  255.  
  256.   So how does it fit together?  Well, when the system boots, lpd is run.
  257.   It scans the file /etc/printcap to learn which printers it will be
  258.   managing spools for.  Each time someone runs lpr, lpr contacts lpd
  259.   through the named socket /dev/printer, and feeds lpd both the file to
  260.   print and some information about who is printing and how to print it.
  261.   Lpd then prints the file on the appropriate printer in turn.
  262.  
  263.   The lp system was originally designed when most printers were line
  264.   printers - that is, people mostly printed plain ascii.  As it turns
  265.   out, only a little extra scripting is needed to make lpd work quite
  266.   well for today's print jobs, which are often in PostScript, or text,
  267.   or dvi, or...
  268.  
  269.   7.  How to set things up, basic
  270.  
  271.   7.1.  Traditional lpd configuration
  272.  
  273.   The minimal setup for lpd rsults in a system that can queue files and
  274.   print them.  It will not pay any attention to wether or not your
  275.   printer will understand them, and will probably not let you produce
  276.   attractive output.  Nevertheless, it is the first step to
  277.   understanding, so read on!
  278.  
  279.   Basically, to add a print queue to lpd, you must add an entry in
  280.   /etc/printcap, and make the new spool directory under /var/spool/lpd.
  281.  
  282.   An entry in /etc/printcap looks like:
  283.  
  284.        # LOCAL djet500
  285.        lp|dj|deskjet:\
  286.                :sd=/var/spool/lpd/dj:\
  287.                :mx#0:\
  288.                :lp=/dev/lp0:\
  289.                :sh:
  290.  
  291.   This defines a spool called lp, dj, or deskjet, spooled in the direc¡
  292.   tory /var/spool/lpd/dj, with no per-job maximum size limit, which
  293.   prints to the device /dev/lp0, and which does not have a banner page
  294.   (with the name of the person who printed, etc) added to the front of
  295.   the print job.
  296.  
  297.   Go now and read the man page for printcap.
  298.  
  299.   The above looks very simple, but there a catch - unless I send in
  300.   files a DeskJet 500 can understand, this DeskJet will print strange
  301.   things.  For example, sending an ordinary Unix text file to a deskjet
  302.   results in literally interpreted newlines, and gets me:
  303.  
  304.        This is line one.
  305.                         This is line two.
  306.                                          This is line three.
  307.  
  308.   ad nauseam.  Printing a PostScript file to this spool would get a
  309.   beautiful listing of the PostScript commands, printed out with this
  310.   "staircase effect", but no useful output.
  311.  
  312.   Clearly more is needed, and this is the purpose of filtering.  The
  313.   more observant of you who read the printcap man page might have
  314.   noticed the spool attributes if and of.  Well, if, or the input
  315.   filter, is just what we need here.
  316.  
  317.   If we write a small shell script called filter that adds carriage
  318.   returns before newlines, the staircasing can be eliminated.  So we
  319.   have to add in an if line to our printcap entry above:
  320.  
  321.        lp|dj|deskjet:\
  322.                :sd=/var/spool/lpd/dj:\
  323.                :mx#0:\
  324.                :lp=/dev/lp0:\
  325.                :if=/var/spool/lpd/dj/filter:\
  326.                :sh:
  327.  
  328.   A simple filter script might be:
  329.  
  330.        #!perl
  331.        # The above line should really have the whole path to perl
  332.        # This script must be executable: chmod 755 filter
  333.        while(<STDIN>){chop $_; print "$_\r\n";};
  334.        # You might also want to end with a form feed: print "\f";
  335.  
  336.   If we were to do the above, we'd have a spool to which we could print
  337.   regular Unix text files and get meaningful results.  (Yes, there are
  338.   four million better ways to write this filter, but few so illustra¡
  339.   tive.  You are encouraged to do this more efficiently.)
  340.  
  341.   The only remaining problem is that printing plain text is really not
  342.   too hot - surely it would be better to be able to print PostScript and
  343.   other formatted or graphic types of output.  Well, yes, it would, and
  344.   it's easy to do.  The method is simply an extention of the above
  345.   linefeed-fixing filter.  If you write a filter than can accept
  346.   arbitrary file types as input and produce DeskJet-kosher output for
  347.   each case, then you've got a clever print spooler indeed!
  348.  
  349.   Such a filter is called a magic filter.  Don't bother writing one
  350.   yourself unless you print strange things - there are a good many
  351.   written for you already on the net.
  352.  
  353.   7.2.  File Permissions
  354.  
  355.   By popular demand, I include below a listing of the permissions on
  356.   interesting files on my system.  There are a number of better ways to
  357.   do this, ideally using only SGID binaries and not making everything
  358.   SUID root, but this is how my system came out of the box, and it works
  359.   for me.  (Quite frankly, if your vendor can't even ship a working lpd
  360.   you're in for a rough ride).
  361.  
  362.        -r-sr-sr-x   1 root     lp    /usr/bin/lpr*
  363.        -r-sr-sr-x   1 root     lp    /usr/bin/lprm*
  364.        -rwxr--r--   1 root     root  /usr/sbin/lpd*
  365.        -r-xr-sr-x   1 root     lp    /usr/sbin/lpc*
  366.        drwxrwxr-x   4 root     lp    /var/spool/lpd/
  367.        drwxr-xr-x   2 root     lp    /var/spool/lpd/lp/
  368.  
  369.   Lpd must currently be run as root so that it can bind to the low-
  370.   numbered lp service port.  It should probably become UID lp.lp or
  371.   something after binding, but I don't think it does.  Bummer.
  372.  
  373.   8.  Getting Printing Software
  374.  
  375.   Many prewritten filter packages (and other printer-related software)
  376.   are available from SunSite
  377.   <ftp://sunsite.unc.edu/pub/Linux/system/printing/>.  Such utilities as
  378.   psutils, a2ps, mpage, dvitodvi, flpr, etc can all be found there.
  379.  
  380.   8.1.  Magicfilter
  381.  
  382.   Magic filter is one of the fully-featured filter packages out there;
  383.   it is designed to be installed in 10 minutes.  I'm told it also
  384.   includes special support for LPRng.
  385.  
  386.        Title:          magicfilter
  387.        Version:        1.1b
  388.        Entered-date:   04APR95
  389.        Description:    A customizable, extensible automatic printer filter.
  390.                        Lets you automatically detect and print just about any
  391.                        data type you can find a conversion utility for.  This
  392.                        filter is written in C and is controlled completely
  393.                        from an external printer configuration file.
  394.                        This version adds automagic creation of configuration
  395.                        files based on the installed software on your system,
  396.                        courtesy of GNU Autoconf.
  397.                        This version is a bug fix from 1.1/1.1a; filters for
  398.                        non-ASCII capable PostScript printers have been added.
  399.        Author:         H. Peter Anvin <hpa@zytor.com>
  400.        Primary-site:   sunsite.unc.edu
  401.                        53000 /pub/Linux/system/printing/magicfilter-1.1b.tar.gz
  402.        Copying-policy: GPL
  403.  
  404.   8.2.  APS Filter
  405.  
  406.   Another of the many magic filter packages is aps filter, by Andreas
  407.   Klemm.  The Linux Software Map entry goes something like this:
  408.        Begin3
  409.        Title:          apsfilter
  410.        Version:        4.9.1
  411.        Entered-date:   Montag, 10. Juli 1995, 21:22:35 Uhr MET DST
  412.        Description:    magicfilter for lpd with auto filetype detection
  413.        Keywords:       lpd magicfilter aps apsfilter
  414.        Original-site:  sunsite.unc.edu
  415.                        /pub/Linux/system/printing/
  416.                        211KB aps-491.tgz
  417.        Platforms:      C-Compiler, gs Postscript emulator, pbmutils
  418.        Copying-policy: GPL
  419.        End
  420.  
  421.   APS filter installs as an if filter for a print queue, and will trans¡
  422.   late from many common file types into your printer's command set.  It
  423.   understands, for example, text, PostScript, dvi, gif, and others.
  424.  
  425.   8.3.  EZ-Magic
  426.  
  427.   EZ-Magic is another filter package, written in bash, available on
  428.   sunsite.
  429.  
  430.        Title:          ez-magic printer filter
  431.        Version:        1.0.5
  432.        Entered-date:   January 26, 1997
  433.        Description:    ez-magic is a printer filter that supports 8 common file
  434.                        formats (txt,ps,gif,bmp,pcx,png,jpg,tif) for printing.
  435.                        It can print over a network (SMB), or to a local printer.
  436.                        Reads from a file, STDIN, or lpd. Simple to use and
  437.                        configure. Just one script file, no huge manuals and
  438.                        multibillion drivers. The only catch is that you need a
  439.                        few common helper programs like netpbm and ghostscript.
  440.                        Written in bash. Easy to add formats and code. Still more
  441.                        bugs than I have appendages, but less than the number of
  442.                        grams of fat in a hot dog. Pre-configured for HP DeskJet
  443.                        870Cse over network. Comparable to apsfilter and others.
  444.        Keywords:       magic filter, print, graphics, samba, network, smb,
  445.                        ghostscript, postscript, gif, jpg, simple
  446.        Author:         toby@eskimo.com (Toby Reed)
  447.        Maintained-by:  toby@eskimo.com (Toby Reed)
  448.        Primary-site:   http://www.eskimo.com/~toby/ez-magic-1.0.5.tar.gz
  449.                                 38 kb ez-magic-1.0.5.tar.gz
  450.        Alternate-site: sunsite.unc.edu /pub/Linux/system/printing
  451.                                 38 kb ez-magic-1.0.5.tar.gz
  452.        Copying-policy: Copyrighted, full manipulation rights, with one or two
  453.                        restrictions.
  454.  
  455.   9.  Vendor Solutions
  456.  
  457.   This section is, by definition, incomplete.  Feel free to send in
  458.   details of your favourite distribution.
  459.  
  460.   9.1.  Red Hat
  461.  
  462.   Red Hat has a GUI printer administration tool which can add remote
  463.   printers and printers on local devices.  It lets you choose a
  464.   ghostscript-supported printer type and Unix device file to print to,
  465.   then installs a print queue in /etc/printcap and writes a short
  466.   PostScript-and-ascii magic filter based around gs and nenscript.  This
  467.   solution works fairly well, and is trivial to setup for common cases.
  468.  
  469.   9.2.  Other Distributions
  470.  
  471.   Please send me info on what other distributions do!
  472.  
  473.   10.  Ghostscript.
  474.  
  475.   Ghostscript is an incredibly significant program for Linux printing.
  476.   Most printing software under Unix generates PostScript, which is
  477.   typically a $100 option on a printer.  Ghostscript, however, is free,
  478.   and will generate the language of your printer from PostScript.  When
  479.   tied in with your lpd input filter, it gives you a virtual PostScript
  480.   printer and simplifies life immensely.
  481.  
  482.   Ghostscript is available in two forms.  The commercial version of
  483.   Ghostscript, called Aladdin Ghostscript, may be used freely for
  484.   personal use but may not be distributed by commercial Linux
  485.   distributions.  It is generally a year or so ahead of the free
  486.   Ghostscript; at the moment, for example, it supports Adobe Acrobat's
  487.   Portable Document Format, while the older Ghostscripts do not.
  488.  
  489.   The free version of Ghostscript is GNU Ghostscript, and is simply an
  490.   aged version of Aladdin ghostscript kindly given to GNU.  (Kudos to
  491.   Aladdin for this arrangement; more software vendors should support
  492.   free software in this way).
  493.  
  494.   Whatever you do with gs, be very sure to run it with the option for
  495.   disabling file access (-dSAFER).  PostScript is a fully functional
  496.   language, and a bad PostScript program could give you quite a
  497.   headache.
  498.  
  499.   Speaking of PDF, Adobe's Portable Document Format is actually little
  500.   more than organized PostScript in a compressed file.  Ghostscript can
  501.   handle PDF input just as it does PostScript.  So you can be the first
  502.   on your block with a PDF-capable printer.
  503.  
  504.   10.1.  Invoking Ghostscript
  505.  
  506.   Typically, ghostscript will be run by whatever magic filter you settle
  507.   upon, but for debugging purposes it's often handy to run it directly.
  508.  
  509.   gs -help will give a brief informative listing of options and
  510.   available drivers (note that this list is the list of drivers compiled
  511.   in, not the master list of all available drivers).
  512.  
  513.   You might run gs for testing purposes like: gs options -q -dSAFER
  514.   -sOutputFile=/dev/lp1 test.ps.
  515.  
  516.   10.2.  Ghostscript output tuning
  517.  
  518.   There are a number of things one can do if gs's output is not
  519.   satisfactory (actually, you can do anything you darn well please,
  520.   since you have the source).
  521.  
  522.   10.2.1.  Output location and size
  523.  
  524.   The location, size, and aspect ratio of the image on a page is
  525.   controlled by the printer-specific driver in ghostscript.  If you find
  526.   that your pages are coming out scrunched too short, or too long, or
  527.   too big by a factor of two, you might want to look in your driver's
  528.   source module and adjust whatever parameters jump out at you.
  529.   Unfortunately, each driver is different, so I can't really tell you
  530.   what to adjust, but most of them are reasonably well commented.
  531.  
  532.   10.2.2.  Gamma, dotsizes, etc.
  533.  
  534.   Most non-laser printers suffer from the fact that their dots are
  535.   rather large. This results in pictures coming out too dark. If you
  536.   experience this problem you should use your own transfer function.
  537.   Simply create the following file in the ghostscript lib-dir and add
  538.   its name to the gs call just before the actual file. You may need to
  539.   tweak the actual values to fit your printer. Lower values result in a
  540.   brighter print.  Especially if your driver uses a Floyd-Steinberg
  541.   algorithm to rasterize colors, lower values ( 0.2 - 0.15 ) are
  542.   probably a good choice.
  543.  
  544.        ---8<---- gamma.ps ----8<---
  545.        %!
  546.        %transfer functions for cyan magenta yellow black
  547.        {0.3 exp} {0.3 exp} {0.3 exp} {0.3 exp} setcolortransfer
  548.        ---8<------------------8<---
  549.  
  550.   It is also possible to mend printers that have some kind of colour
  551.   fault by tweaking these values. If you do that kind of thing, I
  552.   recommend using the file colorcir.ps, that comes with ghostscript (in
  553.   the examples/ subdir), as a test page.
  554.  
  555.   11.  How to print to a printer over the network
  556.  
  557.   One of the features of lpd is that it supports printing over the
  558.   network to printers physically connected to a different machine.  With
  559.   the careful combination of filter scripts and assorted utilities, you
  560.   can make lpr print transparently to printers on all sorts of networks.
  561.  
  562.   11.1.  To a Unix/lpd host
  563.  
  564.   To allow remote machines to print to your printer, you must list the
  565.   machines in /etc/hosts.equiv or /etc/hosts.lpd.  (Note that
  566.   hosts.equiv has a host of other effects; be sure you know what you are
  567.   doing if you list any machine there).  You can allow only certain
  568.   users on the other machines to print to your printer by usign the rs
  569.   attribute; read the lpd man page for information on this.
  570.  
  571.   11.1.1.  With lpd
  572.  
  573.   To print to another machine, you make an /etc/printcap entry like
  574.   this:
  575.  
  576.   # REMOTE djet500
  577.   lp|dj|deskjet:\
  578.           :sd=/var/spool/lpd/dj:\
  579.           :rm=machine.out.there.com:\
  580.           :rp=printername:\
  581.           :lp=/dev/null:\
  582.           :sh:
  583.  
  584.   Note that there is still a spool directory on the local machine man¡
  585.   aged by lpd.  If the remote machine is busy or offline, print jobs
  586.   from the local machine wait in the spool area until they can be sent.
  587.  
  588.   11.1.2.  With rlpr
  589.  
  590.   You can also use rlpr to send a print job directly to a queue on a
  591.   remote machine without going through the hassle of configuring lpd to
  592.   handle it.  This is mostly useful in situations where you print to a
  593.   variety of printers only occasionally.  From the announcement for
  594.   rlpr:
  595.  
  596.   Rlpr uses TCP/IP to send print jobs to lpd servers anywhere on a
  597.   network.
  598.  
  599.   Unlike lpr, it *does not* require that the remote printers be
  600.   explicitly known to the machine you wish to print from, (e.g. through
  601.   /etc/printcap) and thus is considerably more flexible and requires
  602.   less administration.
  603.  
  604.   rlpr can be used anywhere a traditional lpr might be used, and is
  605.   backwards compatible with traditional BSD lpr.
  606.  
  607.   The main power gained by rlpr is the power to print remotely *from
  608.   anywhere to anywhere* without regard for how the system you wish to
  609.   print from was configured.  Can work as a filter just like traditional
  610.   lpr so that clients executing on a remote machine like netscape,
  611.   xemacs, etc, etc can print to your local machine with little effort.
  612.  
  613.   Rlpr is available from SunSite
  614.   <ftp://sunsite.unc.edu/pub/Linux/system/printing/>.
  615.  
  616.   11.2.  To a Win95, WinNT, LanManager, or Samba printer
  617.  
  618.   There is a Printing to Windows mini-HOWTO out there which has more
  619.   info than there is here.
  620.  
  621.   It is possible to direct an lpd queue through the smbclient program
  622.   (part of the samba suite) to a TCP/IP based SMB print service.  Samba
  623.   includes a script to do this called smbprint.  In short, you put a
  624.   configuration file for the specific printer in question in the spool
  625.   directory, and install the smbprint script as the if.
  626.  
  627.   The /etc/printcap entry goes like this:
  628.  
  629.   lp|remote-smbprinter:\
  630.       :lp=/dev/null:sh:\
  631.       :sd=/var/spool/lpd/lp:\
  632.       :if=/usr/local/sbin/smbprint:
  633.  
  634.   You should read the documentation inside the smbprint script for more
  635.   information on how to set this up.
  636.  
  637.   You can also use smbclient to submit a file directly to an SMB
  638.   printing service without involving lpd.  See the man page.
  639.  
  640.   11.3.  To a NetWare Printer
  641.  
  642.   The ncpfs suite includes a utility called nprint which provides the
  643.   same functionality as smbprint but for NetWare.  You can get ncpfs
  644.   from SunSite.  From the LSM entry for version 0.16:
  645.  
  646.        With ncpfs you can mount volumes of your netware server
  647.        under Linux. You can also print to netware print queues and
  648.        spool netware print queues to the Linux printing system. You
  649.        need kernel 1.2.x or 1.3.54 and above. ncpfs does NOT work
  650.        with any 1.3.x kernel below 1.3.54.
  651.  
  652.   To make nprint work via lpd, you write a little shell script to print
  653.   stdin on the NetWare printer, and install that as the if for an lpd
  654.   print queue.  You'll get something like:
  655.  
  656.        sub2|remote-NWprinter:\
  657.                :lp=/dev/null:sh:\
  658.                :sd=/var/spool/lpd/sub2:\
  659.                :if=/var/spool/lpd/nprint-script:
  660.  
  661.   The nprint-script might look approximately like:
  662.  
  663.        #! /bin/sh
  664.        # You should try the guest account with no password first!
  665.        /usr/local/bin/nprint -S net -U name -P passwd -q printq-name -
  666.  
  667.   11.4.  To an EtherTalk (Apple) printer
  668.  
  669.   The netatalk package includes something like nprint and smbclient.
  670.   Others have documented the procedure for printing to and from an Apple
  671.   network far better than I ever will; see the Linux Netatalk-HOWTO
  672.   <http://thehamptons.com/anders/netatalk/>.
  673.  
  674.   Obscure caveat of the week: Netatalk does not work with SMC Etherpower
  675.   PCI Card with a DEC tulip chip.
  676.  
  677.   11.5.  To an HP or other ethernet printer
  678.  
  679.   HPs and some other printers come with an ethernet interface which you
  680.   can print to directly using lpd.  You should follow the instructions
  681.   that came with your printer or its network adaptor, but in general,
  682.   such printers are "running" lpd, and provide one or more queues which
  683.   you can print to.  An HP, for example, might work with a printcap
  684.   like:
  685.  
  686.        lj-5|remote-hplj:\
  687.                :lp=/dev/null:sh:\
  688.                :sd=/var/spool/lpd/lj-5:\
  689.                :rm=printer.name.com:rp=raw:
  690.  
  691.   HP Laserjet printers with Jet Direct interfaces generally support two
  692.   built in lpd queues - "raw" which accepts PCL (and possibly
  693.   Postscript) and "text" which accepts straight ascii (and copes
  694.   automatically with the staircase effect).
  695.  
  696.   In a large scale environment, especially a large environment where
  697.   some printers do not support PostScript, it may be useful to establish
  698.   a dedicated print server to which all machines print and on which all
  699.   ghostscript jobs are run.
  700.  
  701.   This also allows your Linux box to act as a spool server for the
  702.   printer so that your network users can complete their print jobs
  703.   quickly and get on with things without waiting for the printer to
  704.   print any other job that someone else has sent.
  705.  
  706.   To do this, set up a queue on you linux box that points at the
  707.   ethernet equipped HP LJ (as above). Now set up all the clients on your
  708.   LAN to point at the Linux queue (eg lj-5 in the example above).
  709.  
  710.   Some HP network printers apparently don't heed the banner page setting
  711.   sent by clients; you can turn off their internally generated banner
  712.   page by telnetting tot he printer, hitting return twice, typing
  713.   "banner: 0" followed by "quit".  There are other settings you can
  714.   change this way, as well; type "?" to see a list.
  715.  
  716.   11.5.1.  To older HPs
  717.  
  718.   Some printers (and printer networking "black boxes") support only a
  719.   cheesy little non-protocol involving plain TCP connections.  Notable
  720.   in this category are early-model JetDirect (including some
  721.   JetDirectEx) cards.  Basically, to print to the printer, you must open
  722.   a TCP connection to the printer on a specified port (typically 9100)
  723.   and stuff your print job into it.  This can be implemented, among
  724.   other ways, in Perl:
  725.  
  726.   #!/usr/bin/perl
  727.   # Thanks to Dan McLaughlin for writing the original version of this
  728.   # script (And to Jim W. Jones for sitting next to Dan when writing me
  729.   # for help ;)
  730.  
  731.   $fileName = @ARGV[0];
  732.  
  733.   open(IN,"$fileName") || die "Can't open file $fileName";
  734.  
  735.   $dpi300     = "\x1B*t300R";
  736.   $dosCr      = "\x1B&k3G";
  737.   $ends = "\x0A";
  738.  
  739.   $port =  9100 unless $port;
  740.   $them = "bach.sr.hp.com" unless $them;
  741.  
  742.   $AF_INET = 2;
  743.   $SOCK_STREAM = 1;
  744.   $SIG{'INT'} = 'dokill';
  745.   $sockaddr = 'S n a4 x8';
  746.  
  747.   chop($hostname = `hostname`);
  748.   ($name,$aliases,$proto) = getprotobyname('tcp');
  749.   ($name,$aliases,$port) = getservbyname($port,'tcp')
  750.       unless $port =~ /^\d+$/;;
  751.   ($name,$aliases,$type,$len,$thisaddr) =
  752.           gethostbyname($hostname);
  753.   ($name,$aliases,$type,$len,$thataddr) = gethostbyname($them);
  754.   $this = pack($sockaddr, $AF_INET, 0, $thisaddr);
  755.   $that = pack($sockaddr, $AF_INET, $port, $thataddr);
  756.  
  757.   if (socket(S, $AF_INET, $SOCK_STREAM, $proto)) {
  758.   #    print "socket ok\n";
  759.   }
  760.   else {
  761.       die $!;
  762.   }
  763.   # Give the socket an address.
  764.   if (bind(S, $this)) {
  765.   #    print "bind ok\n";
  766.   }
  767.   else {
  768.       die $!;
  769.   }
  770.  
  771.   # Call up the server.
  772.  
  773.   if (connect(S,$that)) {
  774.   #    print "connect ok\n";
  775.   }
  776.   else {
  777.       die $!;
  778.   }
  779.  
  780.   # Set socket to be command buffered.
  781.  
  782.   select(S); $| = 1; select(STDOUT);
  783.  
  784.   #    print S "@PJL ECHO Hi $hostname! $ends";
  785.   #    print S "@PJL OPMSG DISPLAY=\"Job $whoami\" $ends";
  786.   #    print S $dpi300;
  787.  
  788.   # Avoid deadlock by forking.
  789.  
  790.   if($child = fork) {
  791.       print S $dosCr;
  792.       print S $TimesNewR;
  793.  
  794.       while (<IN>) {
  795.           print S;
  796.       }
  797.       sleep 3;
  798.       do dokill();
  799.   } else {
  800.       while(<S>) {
  801.           print;
  802.       }
  803.   }
  804.  
  805.   sub dokill {
  806.       kill 9,$child if $child;
  807.   }
  808.  
  809.   11.6.  Running an if for remote printers
  810.  
  811.   One oddity of lpd is that the if is not run for remote printers.  If
  812.   you find that you need to run an if, you can do so by setting up a
  813.   double queue and requeueing the job.  As an example, consider this
  814.   printcap:
  815.  
  816.        lj-5:remote-hplj:\
  817.                :lp=/dev/null:sh:\
  818.                :sd=/var/spool/lpd/lj-5:\
  819.                :if=/usr/lib/lpd/filter-lj-5:
  820.        lj-5-remote:lp=/dev/null:sh:rm=printer.name.com:\
  821.                :rp=raw:sd=/var/spool/lpd/lj-5-raw:
  822.  
  823.   in light of this filter-lj-5 script:
  824.  
  825.        #!/bin/sh
  826.        gs <options> -q -dSAFER -sOutputFile=- - | \
  827.                lpr -Plj-5-remote -U$5
  828.  
  829.   The -U option to lpr only works if lpr is run as daemon, and it sets
  830.   the submitter's name for the job in the resubmitted queue correctly.
  831.   You should probably use a more robust method of getting the username,
  832.   since in some cases it is not argument 5.  See the man page for
  833.   printcap.
  834.  
  835.   11.7.  From Windows.
  836.  
  837.   Printing from a Windows (or presumably, OS/2) client to a Linux server
  838.   is directly supported over SMB through the use of the SAMBA package,
  839.   which also supports file sharing of your Linux filesystem to Windows
  840.   clients.
  841.  
  842.   Samba includes fairly complete documentation.  You can either
  843.   configure a magic filter on the Linux box and print PostScript to it,
  844.   or run around installing printer-specific drivers on all the Windows
  845.   machines and having a queue for them with no filters at all.  Relying
  846.   on the Windows drivers may in some cases produce better output, but is
  847.   a bit more of an administrative hassle if there are many Windows
  848.   boxen.  So try PostScript first.
  849.  
  850.   11.8.  From an Apple.
  851.  
  852.   Netatalk supports printing from Apple clients over EtherTalk.  See the
  853.   Netatalk HOWTO Page <http://thehamptons.com/anders/netatalk/> for more
  854.   information.
  855.  
  856.   11.9.  From Netware.
  857.  
  858.   There is some Netware service support available for Linux from or
  859.   because of Caldera, but I have no idea if you can offer print services
  860.   to Netware clients.
  861.  
  862.   12.  How to print to a fax machine.
  863.  
  864.   12.1.  Using a faxmodem
  865.  
  866.   There are a number of fax programs out there that will let you fax and
  867.   receive documents.  One of the most complex is Sam Leffler's HylaFax,
  868.   available from ftp.sgi.com.  It supports all sorts of things from
  869.   multiple modems to broadcasting.
  870.  
  871.   Also available, and a better choice for most Linux boxen, is efax, a
  872.   simple program which sends faxes.  The getty program mgetty can
  873.   receive faxes (and even do voicemail on some modems!).
  874.  
  875.   12.2.  Using the Remote Printing Service
  876.  
  877.   There is an experimental service offered that lets you send an email
  878.   message containing something you'd like printed such that it will
  879.   appear on a fax machine elsewhere.  Nice formats like postscript are
  880.   supported, so even though global coverage is spotty, this can still be
  881.   a very useful service.  For more information on printing via the
  882.   remote printing service, see the Remote Printing WWW Site
  883.   <http://www.tpc.int/>.
  884.  
  885.   13.  How to generate something worth printing.
  886.  
  887.   Here we get into a real rat's-nest of software.  Basically, Linux can
  888.   run many types of binaries with varying degrees of success: Linux/x86,
  889.   Linux/Alpha, Linux/Sparc, Linux/foo, iBCS, Win16/Win32s (with dosemu
  890.   and, someday, with Wine), Mac/68k (with Executor), and Java.  I'll
  891.   just discuss native Linux and common Unix software, except to say that
  892.   WordPerfect for SCO, and quite probably other commercial word
  893.   processing software, runs fine under Linux's iBCS emulation, as does
  894.   anything in pure Java (the Corel Office for Java Preview looked quite
  895.   promising).
  896.  
  897.   For Linux itself, choices are mostly limited to those available for
  898.   Unix in general:
  899.  
  900.   13.1.  Markup languages
  901.  
  902.   Most markup languages are more suitable for large or repetitive
  903.   projects, where you want the computer to control the layout of the
  904.   text to make things uniform.  Trying to make a pretty sign in a markup
  905.   language would probably hurt...
  906.  
  907.      nroff
  908.         This was one of the first Unix markup languages.  Man pages are
  909.         the most common examples of things formatted in *roff macros;
  910.         many people swear by them, but nroff has, to me at least, a more
  911.         arcane syntax than needed, and probably makes a poor choice for
  912.         new works.  It is worth knowing, though, that you can typeset a
  913.         man page directly into postscript with groff.  Most man commands
  914.         will do this for you with man -t foo | lpr.
  915.  
  916.      TeX
  917.         TeX, and the macro package LaTeX, are one of the most widely
  918.         used markup languages on Unix.  Technical works are frequently
  919.         written in LaTeX because it greatly simplifies the layout issues
  920.         and is still one of the few text processing systems to support
  921.         mathematics both completely and well.  TeX's output format is
  922.         dvi, and is converted to PostScript or Hewlett Packard's PCL
  923.         with dvips or dvilj.
  924.  
  925.      SGML
  926.         There is at least one free sgml parser available for Unix and
  927.         Linux; it forms the basis of Linuxdoc-SGML's homegrown document
  928.         system.  It can support other DTD's, as well.
  929.  
  930.      HTML
  931.         Someone suggested that for simple projects, it may suffice to
  932.         write it in HTML and print it out using Netscape.  I disagree,
  933.         but YMMV.
  934.  
  935.   13.2.  WYSIWYG Word Processors
  936.  
  937.   There is no longer any shortage of WYSIWYG word processing software.
  938.   Several complete office suites are available, including one that's
  939.   free for personal use (StarOffice).
  940.  
  941.      StarOffice
  942.         A German company is distributing StarOffice 3.1 (as opposed to
  943.         the newer version 4) on the net free for Linux.  This full-blown
  944.         office suite has all the features you'd expect, and you can't
  945.         beat the price.  There's a mini-HOWTO out there which describes
  946.         how to obtain and install it.  It generates PostScript or PCL,
  947.         so should work with most any printer that works otherwise on
  948.         Linux.
  949.  
  950.      LyX
  951.         LyX is a front-end to LaTeX which looks very promising.  See the
  952.         LyX Homepage <http://www-pu.informatik.uni-
  953.         tuebingen.de/users/ettrich/> for more information.
  954.  
  955.      The Andrew User Interface System
  956.         AUIS includes ez, a WYSIWYG-style editor with most basic word
  957.         processor features, HTML capabilities, and full MIME email and
  958.         newsgroup support.
  959.  
  960.      Commercial offerings
  961.         At least Caldera and Red Hat ship packages containing the usual
  962.         office apps like a WYSIWYGish word processor and a spreadsheet.
  963.         I would assume they do a dandy job, but I've never used them.  I
  964.         think Caldera also ships Sun's WABI, so you could probably run
  965.         something like MS Office under that if you had to integrate with
  966.         other folks' files.
  967.  
  968.         Jeff Phillips <jeff@I_RATUS.org> uses Caldera's WordPerfect for
  969.         Linux (on Slackware, of all things) and says that it works well.
  970.         It apparently includes built-in printer support, as one would
  971.         expect.  Caldera should have info on  <http://www.caldera.com/>.
  972.  
  973.         RedHat ships a suite called Applixware; you can find their web
  974.         site at  <http://www.redhat.com/>.
  975.  
  976.         Other vendors feel free to drop me a line with your offerings.
  977.  
  978.   14.  On-screen previewing of printable things.
  979.  
  980.   Nearly anything you can print can be viewed on the screen, too.
  981.  
  982.   14.1.  PostScript
  983.  
  984.   Ghostscript has an X11 driver best used under the management of the
  985.   PostScript previewer Ghostview.  The latest versions of these programs
  986.   should be able to view PDF files, as well.
  987.  
  988.   14.2.  TeX dvi
  989.  
  990.   TeX DeVice Independant files may be previewed under X11 with xdvi.
  991.   Modern versions of xdvi call ghostscript to render PostScript
  992.   specials.
  993.  
  994.   A VT100 driver exists as well.  It's called dgvt.  Tmview works with
  995.   Linux and svgalib, if that's all you can do.
  996.  
  997.   14.3.  Adobe PDF
  998.  
  999.   Adobe's Acrobat Reader is available for Linux; just download it form
  1000.   their web site  <http://www.adobe.com/>.
  1001.  
  1002.   You can also use xpdf, which is freeware and comes with source, and I
  1003.   should think Ghostview supports viewing PDF files with gs under X11 by
  1004.   now.
  1005.  
  1006.   15.  Serial printers under lpd
  1007.  
  1008.   15.1.  Setting up in printcap
  1009.  
  1010.   Lpd provides five attributes which you can set in /etc/printcap to
  1011.   control all the settings of the serial port a printer is on.  Read the
  1012.   printcap man page and note the meanings of br#, fc#, xc#, fs# and xs#.
  1013.   The last four of these attributes are bitmaps indicating the settings
  1014.   for use the port.  The br# atrribute is simply the baud rate, ie
  1015.   `br#9600'.
  1016.  
  1017.   It is very easy to translate from stty settings to printcap flag
  1018.   settings. If you need to, see the man page for stty now.
  1019.  
  1020.   Use stty to set up the printer port so that you can cat a file to it
  1021.   and have it print correctly. Here's what `stty -a' looks like for my
  1022.   printer port:
  1023.  
  1024.        dina:/usr/users/andy/work/lpd/lpd# stty -a < /dev/ttyS2
  1025.        speed 9600 baud; rows 0; columns 0; line = 0;
  1026.        intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>;
  1027.        eol2 = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W;
  1028.        lnext = ^V; min = 1; time = 0;
  1029.        -parenb -parodd cs8 hupcl -cstopb cread -clocal -crtscts
  1030.        -ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr
  1031.        -igncr -icrnl ixon -ixoff -iuclc -ixany -imaxbel
  1032.        -opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0
  1033.        bs0 vt0 ff0
  1034.        -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase
  1035.        -tostop -echoprt -echoctl -echoke
  1036.  
  1037.   The only changes between this and the way the port is initialized at
  1038.   bootup are -clocal, -crtscts, and ixon. Your port may well be differ¡
  1039.   ent depending on how your printer does flow control.
  1040.  
  1041.   You actually use stty in a somewhat odd way.  Since stty operates on
  1042.   the terminal connected to it's standard input, you use it to
  1043.   manipulate a given serial port by using the `<' character as above.
  1044.  
  1045.   Once you have your stty settings right, so that `cat file >
  1046.   /dev/ttyS2' (in my case) sends the file to the printer, look at the
  1047.   file /usr/src/linux/include/asm-i386/termbits.h. This contains a lot
  1048.   of #defines and a few structs (You may wish to cat this file to the
  1049.   printer (you do have that working, right?) and use it as scratch
  1050.   paper).  Go to the section that starts out
  1051.  
  1052.        /* c_cflag bit meaning */
  1053.        #define CBAUD   0000017
  1054.  
  1055.   This section lists the meaning of the fc# and fs# bits. You will
  1056.   notice that the names there (after the baud rates) match up with one
  1057.   of the lines of stty output. Didn't I say this was going to be easy?
  1058.  
  1059.   Note which of those settings are preceded with a - in your stty
  1060.   output. Sum up all those numbers (they are octal). This represents the
  1061.   bits you want to clear, so the result is your fc# capability.  Of
  1062.   course, remember that you will be setting bits directly after you
  1063.   clear, so you can just use `fc#0177777' (I do).
  1064.  
  1065.   Now do the same for those settings (listed in this section) which do
  1066.   not have a - before them in your stty output. In my example the
  1067.   important ones are CS8 (0000060), HUPCL (0002000), and CREAD
  1068.   (0000200). Also note the flags for your baud rate (mine is 0000015).
  1069.   Add those all up, and in my example you get 0002275. This goes in your
  1070.   fs# capability (`fs#02275' works fine in my example).
  1071.  
  1072.   Do the same with set and clear for the next section of the include
  1073.   file, "c_lflag bits". In my case I didn't have to set anything, so I
  1074.   just use `xc#0157777' and `xs#0'.
  1075.  
  1076.   15.2.  Older serial printers that drop characters
  1077.  
  1078.   Jon Luckey points out that some older serial printers with ten-cent
  1079.   serial interfaces and small buffers really mean stop when they say so
  1080.   with flow control.  He found that disabling the FIFO in his Linux
  1081.   box's 16550 serial port with setserial corrected the problem of
  1082.   dropped characters (you apparently just specify the uart type as an
  1083.   8250 to do this).
  1084.  
  1085.   16.  Credits
  1086.  
  1087.   The smbprint information is from an article by Marcel Roelofs
  1088.   <marcel@paragon.nl>.
  1089.  
  1090.   The nprint information for using Netware printers was provided by
  1091.   Michael Smith <mikes@bioch.ox.ac.uk>.
  1092.  
  1093.   The serial printers under lpd section is from Andrew Tefft
  1094.   <teffta@engr.dnet.ge.com>.
  1095.  
  1096.   The blurb about gammas and such for gs was sent in by Andreas
  1097.   <quasi@hub-fue.franken.de>.
  1098.  
  1099.   The two paragraphs about the 30 second closing_wait of the serial
  1100.   diver was contributed by Cris Johnson <cdj@netcom.com>.
  1101.  
  1102.   Robert Hart sent a few excellent paragraphs about setting up a print
  1103.   server to networked HPs which I used verbatim.
  1104.  
  1105.   And special thanks to the dozens upon dozens of you who've pointed out
  1106.   typos, bad urls, and errors in the document over the years.
  1107.  
  1108.